package com.xianniu.ltc.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;

/**
 * @Author: dingyx
 * @Date: 2021/11/2 8:37 下午
 */
@Getter
public enum NicheWinRate {
    case00("0", "019-017a61371dfc0007", "输单"),
    case10("10", "019-017a613964f9000d", "初步接洽"),
    case30("30", "019-017a61392960000c", "需求确认"),
    case60("60", "019-017a6138b982000b", "方案谈判"),
    case80("80", "019-017a613859b2000a", "待签约"),
    case90("90", "019-017a6137dfff0009", "签约中"),
    case100("100", "019-017a613777930008", "赢单");


    private String rate;
    private String value;
    private String desc;

    NicheWinRate(String rate, String value, String desc){
        this.rate = rate;
        this.value = value;
        this.desc = desc;
    }

    public static NicheWinRate getNicheWinRate(String value){
        if(Objects.nonNull(value)){
            for (NicheWinRate winRate: values()) {
                if(winRate.getValue().equals(value)){
                    return  winRate;
                }
            }
        }
        return null;
    }

    /**
     * 赢单标示
     */
    public static List<String> winCase() {
        return Arrays.asList(case100.value);
    }
    /**
     * 输单标示
     */
    public static List<String> loseCase() {
        return Arrays.asList(case00.value);
    }
    /**
     * 赢率10%-50%商机标示
     */
    public static List<String> case10_50() {
        return Arrays.asList(case10.value, case30.value);
    }

    /**
     * 赢率60%-90%商机标示
     */
    public static List<String> case60_90 () {
        return Arrays.asList(case60.value, case80.value, case90.value);
    }
}
